/*
 Navicat MySQL Data Transfer

 Source Server         : 本机3307
 Source Server Type    : MySQL
 Source Server Version : 50719
 Source Host           : localhost:3307
 Source Schema         : zln_mount_buzhou

 Target Server Type    : MySQL
 Target Server Version : 50719
 File Encoding         : 65001

 Date: 05/05/2020 16:07:11
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for PDMAN_DB_VERSION
-- ----------------------------
DROP TABLE IF EXISTS `PDMAN_DB_VERSION`;
CREATE TABLE `PDMAN_DB_VERSION` (
  `DB_VERSION` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `VERSION_DESC` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL,
  `CREATED_TIME` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Table structure for tb_auth
-- ----------------------------
DROP TABLE IF EXISTS `tb_auth`;
CREATE TABLE `tb_auth` (
  `id` bigint(20) NOT NULL,
  `username` varchar(127) COLLATE utf8mb4_bin DEFAULT '',
  `password` varchar(127) COLLATE utf8mb4_bin DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `tb_auth_username_uindex` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='密码表';

-- ----------------------------
-- Records of tb_auth
-- ----------------------------
BEGIN;
INSERT INTO `tb_auth` VALUES (1, 'admin', '123456');
COMMIT;

-- ----------------------------
-- Table structure for tb_connection_log
-- ----------------------------
DROP TABLE IF EXISTS `tb_connection_log`;
CREATE TABLE `tb_connection_log` (
  `id` bigint(20) NOT NULL COMMENT '主键',
  `channel_id` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT 'channelId websocke连接id',
  `action_type` int(11) NOT NULL DEFAULT '-1' COMMENT '动作 1-连接\n2-注册成功\n3-注册失败\n4-心跳包\n5-客户端掉线\n6-服务端主动断开\n99-其他',
  `note` varchar(128) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '备注',
  `area` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '区域编码',
  `org_code` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '机构编码',
  `user_id` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '用户id',
  `revision` int(11) DEFAULT NULL COMMENT '乐观锁',
  `created_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新人',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `tcl_user_id_idx` (`user_id`),
  KEY `tcl_org_code_idx` (`org_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='客户端在线情况日志表';

-- ----------------------------
-- Table structure for tb_online
-- ----------------------------
DROP TABLE IF EXISTS `tb_online`;
CREATE TABLE `tb_online` (
  `id` bigint(20) NOT NULL COMMENT 'id',
  `area` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `org_code` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `device` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `user_id` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `channel_id` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `server_inst` varchar(127) COLLATE utf8mb4_bin NOT NULL DEFAULT '127.0.0.1',
  `revision` int(11) DEFAULT NULL COMMENT '乐观锁',
  `created_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新人',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='当前在线设备';

-- ----------------------------
-- Table structure for tb_push_log
-- ----------------------------
DROP TABLE IF EXISTS `tb_push_log`;
CREATE TABLE `tb_push_log` (
  `id` bigint(20) NOT NULL,
  `push_id` varchar(127) COLLATE utf8mb4_bin NOT NULL,
  `msg_id` varchar(127) COLLATE utf8mb4_bin NOT NULL,
  `channel_id` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL,
  `msg` longtext COLLATE utf8mb4_bin COMMENT '推送内容',
  `times` int(11) DEFAULT NULL COMMENT '推送次数',
  `status` int(11) DEFAULT NULL COMMENT '推送状态 0-未推送\n1-推送成功（未确认）\n2-推送失败\n3-客户端已确认送达\n99-其他',
  `note` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '备注',
  `call_back_url` varchar(1024) COLLATE utf8mb4_bin DEFAULT '' COMMENT '推送结果回调地址',
  `revision` int(11) DEFAULT NULL COMMENT '乐观锁',
  `created_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新人',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `tpl_cid_idx` (`channel_id`),
  KEY `tb_push_log_msg_id_index` (`msg_id`),
  KEY `tb_push_log_push_id_index` (`push_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='推送日志';

-- ----------------------------
-- Table structure for test_table
-- ----------------------------
DROP TABLE IF EXISTS `test_table`;
CREATE TABLE `test_table` (
  `id` bigint(20) NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `test_table_id_uindex` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

SET FOREIGN_KEY_CHECKS = 1;
